home *** CD-ROM | disk | FTP | other *** search
/ CD Exchange / CD Exchange - Volume 1.iso / d.t.p / utils / propage / donsgenies / donsgenies.lha / Don'sGenies / MarginsAllRound.pprx < prev    next >
Text File  |  1993-05-25  |  1KB  |  62 lines

  1. /* This Genie puts an equal margin all round a box. 
  2. Written by Don Cox  July '92 Not Public Domain. All rights reserved.  */
  3.  
  4.  
  5. signal on error
  6. signal on syntax
  7. address command
  8. call SafeEndEdit.rexx()
  9. cr="0a"x
  10.  
  11. CurrentUnits = ppm_GetUnits()
  12.  
  13. select
  14.     when CurrentUnits = 1 then units="inches"
  15.     when CurrentUnits = 2 then units="millimetres"
  16.     otherwise units ="points"
  17.     end
  18.  
  19. counter=0
  20.  
  21. do forever
  22.     box=ppm_ClickOnBox("Click on boxes to be changed")
  23.     if box=0 then break
  24.     counter=counter+1
  25.     boxes.counter=box
  26.     call ppm_SelectBox(box)
  27. end
  28.  
  29. if counter=0 then exit_msg()
  30.  
  31. size = ppm_GetUserText(6,"Margin in "units)
  32. if size = "" then exit_msg("Aborted by User")
  33. if CurrentUnits = 2 then size = size/10  /* mm to cm */
  34. else if CurrentUnits = 3 then size = size/12  /* points to picas */
  35.  
  36. do i=1 to counter
  37.     box=boxes.i
  38.     call ppm_SetBoxMargins(box,size,size,size,size)
  39.     
  40.     end
  41.  
  42. call exit_msg()
  43.  
  44. end
  45.  
  46. error:
  47. syntax:
  48.     do
  49.     exit_msg("Genie failed due to error: "errortext(rc))
  50.     end
  51.  
  52. exit_msg:
  53.     do
  54.     parse arg message
  55.     if message ~= "" then
  56.     call ppm_Inform(1,message)
  57.     call ppm_ClearStatus()
  58.     call ppm_AutoUpdate(1)
  59.     exit
  60.     end
  61.  
  62.